const Controller = require("egg").Controller;

class ArticleController extends Controller {
  data = {
    a1: [
      {
        comment: "111",
        id: "123",
      },
      {
        comment: "111",
        id: "123",
      },
    ],
  };

  findDelComment(id, commitId) {
    const comments = this.data[id];
    return comments.find((item) => item.id === commitId);
  }

  async index() {
    console.log(this.ctx.params);
    const { id, commitId } = this.ctx.params;

    this.ctx.body = this.findDelComment(id, commitId);
  }
}

module.exports = ArticleController;
